package com.xxljob.wry.task;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <h1> 任务-同步某个方法 </h1>
 *
 * @author wry
 * @since 2023.04.06
 */
@Component
@Slf4j
public class TaskService {

    @XxlJob("task-01")
    public ReturnT<String> myTask() throws Exception{
        log.info("定时任务 触发开始.... {}", LocalDateTime.now());
        Thread.sleep(5000L);
        log.info("定时任务 触发结束---- {}", LocalDateTime.now());
       return ReturnT.SUCCESS;
    }
}
